<template>
	<view>
		<view class="fui-header fui-header-success">
			<view class="fui-header-left iconfont icon-fanhui" @click="result" ></view>
			<view class="title">订单备注</view>
		</view>
		<view class="status_bar"></view>
		<view class="fui-content navbar">		
			<view class="fui-title">备注信息</view>
			<view class="fui-cell-group">
				<view class="fui-cell fui-cell-textarea">
					<view class="fui-cell-info">
						<textarea v-model="remarksaler" placeholder="请输入备注信息" id="remarksaler"/>
					</view>
				</view>
			</view>	
		</view>
		<view class="fui-navbar">
			<view class="nav-item btn btn-gray cancel-params" @click="result">取消</view>
			<view class="nav-item btn btn-success submit-params" @click="save">保存</view>
		</view>
	</view>
</template>

<script>
var t = getApp().globalData,
	e = t.requirejs('core'),
	i = t.requirejs('foxui'),
	a = t.requirejs('jquery');
	export default {
		data() {
			return {
				remarksaler:'',
				id:''
				
			}
		},
		onShow(){
			this.init()
		},
		onLoad(e){
			this.id=e.id
		},
		methods: {
			init(){
				
			},
			save(){
				let self=this
				let pages = getCurrentPages();
				//订单备注
				uni.showModal({
				    title: '提示',
				    content: '确定保存修改吗？',
				    success: function (res) {
				        if (res.confirm) {
							e.post('merchmanage.order.op.remarksaler', {remarksaler:self.remarksaler,id:self.id}, function(t) {
								if(t.status){
									uni.showToast({
										title: '备注修改成功',
										icon: 'none',
										duration: 1000,
										success:()=>{
											setTimeout(()=>{
											    if(pages.length<2){
											    	uni.navigateTo({
											    		url: '../merchmanage/merchmanage'
											    	});
											    }else{
											    	uni.navigateBack({
											    		 delta: 1
											    	});	
											    }
											}, 500);

										}
									})
									
								}else{
									return uni.showToast({
										title: '备注修改失败',
										icon: 'none',
										duration: 1000
									})
								}
							});
						}
					  }
					})		
				
			},
			//搜索
			search(){
				
				
			},
			//返回上一页
			result(){
				uni.navigateBack({
					 delta: 1
				});
			}
	},
}	
</script>

<style>
.fui-cell-group .fui-cell uni-textarea{
	height: 100rpx; 
}
.btn.btn-gray{
	background: #bbb;
	border-color: #bbb;
}
.btn.btn-success{
	background: #5cb85c;
	border-color: #5cb85c;
}
.fui-header .iconfont{
	color: #fff;
	font-size: 24rpx;
	padding: 0 20rpx;
}
</style>
